package com.x.erp.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.x.erp.model.MultilevelActivityDetail;
import com.x.erp.rpc.MultilevelActivityDetailRpcService;
import com.x.framework.controller.BaseController;
import com.x.framework.controller.ResultCode;
import com.x.framework.controller.ResultModel;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 多级营销奖励明细
 */
@RestController
@RequestMapping("/multilevelActivityDetail")
public class MultilevelActivityDetailController extends BaseController{

	@Reference
	private MultilevelActivityDetailRpcService multilevelActivityDetailRpcService;// 多级营销奖励明细服务

	/**
	 * 查询用户奖励排行榜
	 * @param
	 * @return
	 */
	@RequestMapping(value = "/getMultilevelActivityDetailTopList", method = {RequestMethod.POST, RequestMethod.GET})
	public ResultModel getMultilevelActivityDetailTopList(MultilevelActivityDetail multilevelActivityDetail) {
		if(multilevelActivityDetail.getPageSize() == null){
			return new ResultModel(ResultCode.RESULT_FAIL, "排行榜条数不能为空！");
		}
		return new ResultModel(ResultCode.RESULT_SUCCESS, "查询成功", multilevelActivityDetailRpcService.selectMultilevelActivityDetailTopList(multilevelActivityDetail));
	}

}
